package zengqiang.day04

fun main(args: Array<String>) {
    println(WEEK.星期一)
    WEEK.values().forEach {
        println(it)
    }

    todo(WEEK.星期日)

    println(COLOR.RED.r) //255
    println(COLOR.RED) //RED
}
fun todo(week: WEEK){
    when (week) {
        in WEEK.星期一..WEEK.星期五-> println("上班")
        WEEK.星期六,WEEK.星期日-> println("休息")
    }
}

enum class WEEK{
    星期一,星期二,星期三,星期四,星期五,星期六,星期日
}

//枚举加强，枚举里面可以创建构造函数
enum class COLOR(var r:Int,var g:Int,var b:Int){
    RED(255,0,0),
    GREEN(0,255,0),
    BLACK(0,0,255)
}